]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dbusServices/extensions: Instruct gjs to generate unique GType names
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 6 Nov 2021 02:34:25 +0000 (03:34 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 5 Jan 2022 19:28:25 +0000 (19:28 +0000)
Like the main gnome-shell process, the extensions service loads code from
extensions. It therefore makes sense to prevent GType name clashes there
as well, just like we already to in the gnome-shell process.

This may break some extensions that use the old type name in .ui files,
but they can be fixed easily by specifying an explicit GTypeName.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2024>

js/dbusServices/extensions/main.js

index 0b6521e9e4bdf3ecdc7db320c7e89040d3b68384..97a28aa98d4de690366e0aac0094ae4ab6a68c0d 100644 (file)
@@ -3,7 +3,7 @@
 imports.gi.versions.Gdk = '4.0';
 imports.gi.versions.Gtk = '4.0';
 
-const { Gtk } = imports.gi;
+const { GObject, Gtk } = imports.gi;
 const pkg = imports.package;
 
 const { DBusService } = imports.dbusService;
@@ -13,6 +13,8 @@ function main() {
     Gtk.init();
     pkg.initFormat();
 
+    GObject.gtypeNameBasedOnJSPath = true;
+
     const service = new DBusService(
         'org.gnome.Shell.Extensions',
         new ExtensionsService());